home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Updates
/
PowerPC
/
chunkyppc
/
chunkyppc.docs
< prev
next >
Wrap
Text File
|
2000-05-16
|
14KB
|
415 lines
The ChunkyPPC Library
=====================
--- snip ---
Newsflash:
This is a major new version of chunkyppc.library.
Note: The new functions are ONLY supported if you use chunkyppc.library
as library, using it with linkchunkyppc.lib does not support the new
functions !!! I included the old version of the linkchunkyppc.lib though,
it just does not cover the new functions of V3+. If you need V3+, use
it as Shared Library.
Mainly i included some new functions on request from *Hyperion Software* !!!
Hyperion wanted a OpenScreen/CloseScreen interface which can handle:
- Open on a Screen
- Open on a WB Window
- Open on a PIP Window
- Open on a Pubscreen
- use ASL Requester, not rtgmaster
- rtgmaster requester optionally
- change screenmodes of a running program "on the fly" (without having
to quit the program)
- automatically handle Chunky-Format Conversions
- Support for all 16 Bit Formats, RGB15 and LUT8 needed
- For AGA 8 Bit and HAM8 needed
- LoadRGB32 Feature with included Color-Adaption for WB-Window
- Doublebuffering (both AllocScreenBuffer and ScrollVPort) and
Triple Buffering Support
- Support for Custom Hooks both on 68k and WarpUP
- has to work on both 68k and PowerPC (WarpUP)
Note: AGA Mode claims to be 15 Bit, but is really 16 Bit :) Just always
use PIXFMT_RGB15 for AGA in ChunkyInit :)
Note: Executables compiled for chunkyppc.library V3-V11 (which were internal
releases anyways) don't work anymore on V11. This is V14. If you have a
Beta V3-V9, don't give it to anyone, to avoid confusion. Only versions
which should be given to other people are V14 or the old V2 ones. But
nothing "in-between".
Note: Due to the special implementation of EGCS-WarpUP the ms.algo cannot
be called directly with it. Use The CallChunkyCopy #define in the
include instead. For other compilers you can just
#define CallChunkyCopy ms.algo
Since V3.0 chunkyppc.library supports these features.
There are the following new functions:
OpenGraphics
------------
a0 : Title (of the program)
a1 : Mode_Screen structure
d0 : override flag
This function opens a screenmode-requester and after this a screen/window.
It uses the following env-variables:
<Title>/modeid:
if the override flag is *not* set, use this modeid, if the ENV Variable
is set (and if not, open a screenmode requester). If the flag is set, always
open a screenmode requester. So default a Screenmode can be used, once the
user saved one, but the screenmode can in-game still be changed.
Since V5 there is (on request of Hyperion Software) a override mode == 2.
If this is set, inside env:<Title> (and envarc:<Title>) there will be a
small Screenmode Database. OpenGraphics() then checks, if a modeid file
is already found in the directory, if this modeid file has the correct
resolution. This way it is possible to maintain several different resolutions
in one database, without the screenmode-requester popping up on every
screen-width/height/depth change (the names of the files are modeid,
modeid1, modeid2, ...). Up to 21 entries (modeid, modeid1, ..., modeid20)
are supported, if more are entered, modeid20 is changed always).
<Title>/dbuf:
Use Doublebuffering
<Title>/oldstyle
If this is set, ScrollVPort will be used, else Triple Buffering using
ScreenBuffers.
<Title>/wb
If this is set, a Workbench Window will be used, not a screen
<Title>/pip
If this is set, a Picture in Picture will be used using the Picasso96API.library.
Note: Not all Graphics Boards Support this. Currently only P96 PIP is supported,
not CGX. Maybe in the future...
<Title>/ham
Use HAM8 mode for AGA. If this is not set, 8 Bit mode is used for AGA.
<Title>/pipnoclear
If this is set to 1, the PIP won't be cleared when opened.
<Title>/rtgmaster
Use rtgmaster Screenmode Requester instead of ASL one. rtgmaster.library
will only be opened when this option is set, so that rtgmaster.library
does not need to be installed to be able to use chunkyppc.library.
<Title>/likecgx
If you want CGX-like WB Window Support for P96 (Faster, but Window Borders
disappear). For CGX it is automatically set, as it is the only possible
method for CGX to reach (at least for 16 Bit) WB Window Support, for P96
it is optional.
Hyperion Software will support a GUI to set these ENV-Variables for their
products, as they told me.
The Mode_Screen structure is a special structure containing information
on the screen, like the Screen-Structure of Intuition or the RtgScreen
structure of rtgmaster. It does not matter if you got it by OpenGraphics
or constructed it yourselves. The Mode_Screen structure also gets the
minimum/maximum Width/Height/Depth, so you should init these values before you
call OpenGraphics.
If the video_screen element of Mode_Screen is !=0 this screen will be closed,
and a new one will be opened ("on-the-fly-screen-change").
The important elements of Mode_Screen (like defined in clib/chunkyppc_protos.h):
video_screen: An Intuition Screen
video_window: An Intuition Window
bpr: Bytes Per Row
mode: The ModeID
SCREENWIDTH: Minimal Width/Actual Width
SCREENHEIGHT: Minimal Height/Actual Height
MAXWIDTH: Maximum Width
MAXHEIGHT: Maximum Height
MINDEPTH: Minimum Depth
MAXDEPTH: Maximum Depth
format: Video Format (using Cybergraphics constants)
video_depth: BitsPerPixel
screen: Buffer 0 Video RAM / Address BitPlane 0
screenb: Buffer 1 Video RAM / Address Bitplane 1
screenc: Buffer 2 Video RAM / Address Bitplane 2
bufnum: Active Buffer number
bitmapa-bitmapc: the Bitmaps
thebitmap: Active Bitmap
numbuffers: Number of Buffers (ScrollVPort only 2, no DBuffering only 1)
algo: Function-pointer to Chunky-Copy Algorithm
CloseGraphics
-------------
a0: Mode_Screen structure
d0: shutdownlibs Flag
This closes the Screen/Window again (and all other stuff... :) )
If shutdownlibs is set, the libraries used will also be closed.
If not they will not be closed.
LoadColors
----------
This is basically the same like LoadRGB32 of graphics.library or
LoadRGBRtg of rtgmaster. Set the colors of a 8 Bit Screen. Does nothing
for a 15/16 Bit Screen.
a0: Mode_Screen structure
a1: Color-array like for LoadRGB32/LoadRGBRtg
DoubleBuffer
------------
a0: Mode_Screen structure
Causes Double/Triplebuffering (depending on value of env:<Title>/oldstyle
and env:<Title>/dbuf). Note WB Window and PIP Modes are single buffered.
For Single-Buffered this does not do anything. For Triplebuffering it
switches buffers in the sequence (when the screen is just opened buffer
0 is always active !!!) <0 is active at startup>-1-2-0-1-2-0 or
<0 is active at startup>-1-0-1-0...
ChunkyInit
----------
r4: Mode_Screen structure
r5: srcformat
This initializes ms->algo with a PowerPC ChunkyCopy/c2p including Colorformat
Conversion according to src and destination format (ms->format...).
ChunkyInit68k
-------------
a0: Mode_Screen structure
d0: srcformat
This time a 68k function, and initializes ms->algo with a 68k algorithm.
If ChunkyInit/ChunkyInit68k returns 0, this means the source and the
destination formats are incompatible !!!
The following formats are compatible currently:
- for PowerPC all 8 Bit and 16 Bit formats, and RGB15 15 Bit Format
- on 68k 8 Bit and all 15 Bit and 16 Bit formats, but 15/16 Bit only
if source and destination have identical formats (68k currently
does not support format conversion)
- For AGA: On Workbench Window only 8 Bit, naturally
- For AGA: HAM8 mode only on PowerPC
- On Workbench Window: 15/16 Bit formats only supported for Picasso 96,
as WritePixelArray of CyberGraphX does not support a 15/16 Bit
Input Format. On a Screen it is supported also for CGX though.
If you want this on CGX too -> write the CGX authors about it.
The Chunky Algorithms
---------------------
68k:
a0: Mode_Screen structure
a1: dest
a2: src
d0: srcformat
d1: hook68k
d2: data
PPC:
r4: Mode_Screen structure
r5: dest
r6: src
r7: srcformat
r8: hook68k
r9: data
This performs a fullscreen copy of "src" to "dest" performing all
needed format conversion. srcformat is in CyberGraphics Synax
(PIXFMT_RGB16 or such). src is a Video RAM Pointer for GFX Board (you
have to take care yourselves, if that of buffer 0,1 or 2 has to be
provided). For AGA it is a poin